/**
 * 通用类型定义
 */
export interface ObjectType {
  [key: string | number]: any;
}

/**
 * 请求相关类型定义
 * @swagger
 * components:
 *   parameters:
 *     PageParam:
 *       in: query
 *       name: page
 *       required: false
 *       description: 页码（可选），用于分页，默认为1
 *       schema:
 *         type: integer
 *         default: 1
 *     SizeParam:
 *       in: query
 *       name: size
 *       required: false
 *       description: 每页数量（可选），用于分页，默认为20
 *       schema:
 *         type: integer
 *         default: 20
 *     UserIdParam:
 *       in: query
 *       name: userId
 *       required: false
 *       description: 用户ID（可选），用于查询指定用户的权限
 *       schema:
 *         type: integer
 */
export class PageRequest {
  userId?: number;
  /** 页码 */
  page: number = 1;
  /** 每页大小 */
  size: number = 20;
}

/**
 * 响应相关类型定义
 * @swagger
 * components:
 *   schemas:
 *     ApiResponse:
 *       type: object
 *       properties:
 *         code:
 *           type: integer
 *           description: 响应状态码
 *         message:
 *           type: string
 *           description: 响应信息
 *         data:
 *           type: object
 *           description: 响应数据,可选
 */
export interface ApiResponse<T = any> {
  /** 响应状态码 */
  code: number;
  /** 响应信息 */
  message: string;
  /** 响应数据,可选 */
  data?: T | null;
}

/**
 * @swagger
 * components:
 *   schemas:
 *     ApiPaginatedResponse:
 *       type: object
 *       properties:
 *         code:
 *           type: integer
 *           description: 响应状态码
 *         message:
 *           type: string
 *           description: 响应信息
 *         data:
 *           type: object
 *           description: 响应数据,可选
 *           properties:
 *             list:
 *               type: array
 *               description: 数据列表
 *             total:
 *               type: integer
 *               description: 总数
 *             pages:
 *               type: integer
 *               description: 总页数
 */
export interface ApiPaginatedResponse<T = any> extends ApiResponse<{ list: T[]; total: number; pages: number }> {}
